<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    {% if show_results %}
    <title>C60 - {% for stop in stops %}{{stop.stop}} {% endfor %}</title>
    {% else %}
    <title>C60</title>
    {% endif %}
  </head>
  <body>
    {% if error %}
        <span style="background:#f88;"><b>{{error}}</b></span>
    {% endif %}
    {% if show_results %}
    {% for stop in stops %}
        {% if stop.error %}
            <span style="background:#88f;">
                <b>{{stop.stop}}</b>&nbsp;
                <b>{{stop.name|default:""}}</b>
            </span>
            <br />
            {% if stop.desc %}
                {{stop.desc}}
                <br />
            {% endif %}
            <span style="color:red;">{{stop.error}}</span>
            <br />
        {% else %}
            <span style="background:#88f;">
                <b>{{stop.stop}}</b>&nbsp;
                <b>{{stop.name}}</b>
            </span>
            <br />
            {{stop.desc}}
            <br />
            <table>
            {% for v in stop.vehicles %}
                <tr>
                <td><b>{{v.0}}</b></td>
                <td>{{v.1|date:"H:i"}} ({{v.2}})</td>
                </tr>
            {% endfor %}
            </table>
        {% endif %}
        <hr />
    {% endfor %}
    <span style="background:#8f8;"><b>{{now|date:"H:i d-M-y"}}</b></span>
    {% endif %}
    
    <form method="get" action="/req">
    <p>
      stop:
      <input type="text" name="s"{% if field_stop %} value="{{field_stop}}"{% endif %} /><br/>
      line:
      <input type="text" name="l"{% if field_line %} value="{{field_line}}"{% endif %} /><br/>
      <input type="submit" value="Submit"/><br/>
      next {% if field_time %}{% ifnotequal field_time "60" %}{{field_time}} minutes{% else %}hour{% endifnotequal %}{% else %}hour{% endif %} only:
      <input type="checkbox" name="t" value='{{field_time|default:"60"}}'{% if field_time %} checked="checked"{% endif %} />
    </p>
    </form>
    <a href="/u">Edit personal list</a>
  </body>
</html>
